import {defineStore} from 'pinia';

const homeStore = defineStore('home', {
    state: () => {
        return {
            leftWidth: -300, // 首页距离左边的距离
            showReview: false,
            currentPlayer: {}, // 当前播放的视频信息
            sendMsgIsFocus: false, // 评论是否有光标
            homeActive: 3, // 首页当前激活的菜单
        }
    },
    getters: {},
    actions: {
        // 更新距离
        updateLeftWidth(width) {
            this.leftWidth = width;
        },
        // 更新评论布尔属性
        updateShowReview(flag) {
            this.showReview = flag;
        },
        // 更新当前播放的视频信息
        updateCurrentPlayer(row) {
            this.currentPlayer = row;
        }
    }
});
export default homeStore
